<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="/admin/css/pintuer.css">
<link rel="stylesheet" href="/admin/css/admin.css">
<script src="/admin/js/jquery.js"></script>
<script src="/admin/js/pintuer.js"></script>
</head>
<body>

	<input type="hidden" name="p" value="1">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 文章列表</strong> <a href="" style="float:right; display:none;"></a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{{url('admin_art/add')}}"> 添加文章</a> </li>
        <li>搜索：</li>

        <li>栏目
          <select name="cat_id" class="input" onchange="changesearch()" style="width:200px; line-height:17px; display:inline-block">
           <option value="">选择栏目</option>
            
	        @foreach($catlist as $list)
	        		 
	        <option value="{{$list->cat_id}}"> {{$list->cat_name}}</option>

            @endforeach
          </select>
          &nbsp;&nbsp;
          
        </li>
        <li>
         点击量
          <select name="art_click" id="click" class="input" onchange="changesearch1()"  style="width:80px; line-height:17px;display:inline-block">
            <option value="">未选择</option>
            <option value="1">从高到低</option>
            <option value="0">从低到高</option>
          </select>
          &nbsp;&nbsp;
          </li>  <li>
         时间
          <select name="art_pubtime" id="pubtime" class="input" onchange="changesearch2()"  style="width:80px; line-height:17px;display:inline-block">
            <option value="">未选择</option>
            <option value="2">最近一周</option>
            <option value="3">近一个月</option>
          </select>
          &nbsp;&nbsp;
          </li>

    <form method="get" id="listform" action="">
        <li>
          <input type="text" placeholder="请输入搜索关键字" name="keyword" class="input" style="width:250px; line-height:17px;display:inline-block" />
          <input class="button border-main icon-search" type="submit" value="搜索"></li>
    </form>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">ID</th>
        <th>栏目名称</th>
       <!--  <th>图片</th> -->
        <th>文章标题</th>    
        <th>文章作者</th>    
        <th width="10%">添加时间</th>
        <th width="310">操作</th>
      </tr>
      <volist name="list" id="vo">

@foreach($artlist as $list)
        <tr>
          <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" value="" />
           {{$list->art_id}}</td>
      
			@foreach($catlist as $cats)
			@if($cats->cat_id == $list->cat_id)
       @foreach($parentid as $par)
      @if($cats->parentid == $par->cat_id)
      <td>{{$par->cat_name}}-
      @endif
      @endforeach
			{{$cats->cat_name}}</td>
			@endif
			@endforeach

          <!-- <td width="10%"><img src="{$goods['goods_img1']}" alt="" width="70" height="50" /></td> -->
          <td>{{$list->art_title}}</td>  
          <td>{{$list->art_author}}</td>
          <td>{{date( 'Y/m/d' , $list->art_pubtime)}}</td>
          <td><div class="button-group"> <a class="button border-main" href="{{url('admin_art/edit',[$list->art_id])}}"><span class="icon-edit"></span> 修改</a>
           <a onclick="return confirm('确定删除本文章吗?')" class="button border-red" href="{{url('admin_art/del',[$list->art_id])}}" ><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
@endforeach
     
      
    </table>
  </div>

			 <div class="pagelist">    {!!$artlist->render()!!}   </div>

            
<script>
  function changesearch1(){
    
      var type = 'art_click';
      var input = $("#click").val();


    $.ajax({
        url:'/checkorder',
        type:'POST',
        data:{"type":type,"input":$("#click").val()},
        async:true,
      success:function(ev){
        console.log(ev);
      }
      });


  }





  // function changesearch2(){
  //      var type = 'art_pubtime';
  //      var input = $("#pubtime").val();
 

  //   $.ajax({
  //       url:'/checklimit',
  //       type:'POST',
  //       data:{"type":type,"input":$("#pubtime").val()},
  //       async:true,
  //     });


 // }
</script>
</body>
</html>